import { getMajorList } from '@/api/asking.js';
import { getList } from '@/api/message.js';
import homeTitle from '@/components/home_title/index.vue';
export default {
	components: {
		homeTitle
	},
	data() {
		return {
			searchValue: '',
			quickLinks: [
				{
					name: '问题库',
					iconSrc: '../../static/img/home/link_01.png',
					url: '../problemBase/index'
				},
				{
					name: '税收法规库',
					iconSrc: '../../static/img/home/link_02.png',
					url: '../../lawBank/revenue/index'
				},
				{
					name: '会计法规库',
					iconSrc: '../../static/img/home/link_03.png',
					url: '../../lawBank/accountant/index'
				},
				{
					name: '优惠政策',
					iconSrc: '../../static/img/home/link_05.png',
					url: '../../lawBank/favorable/index'
				},
				{
					name: '小竹资讯',
					iconSrc: '../../static/img/home/link_07.png',
					url: '/consult/index/index'
				},
			],
			consultInfo: {
				title: '小竹资讯',
				url: '/consult/index/index',
				type: 2
			},
			teacherList: [],
			consultList: [],
		};
	},
	methods: {
		jumpSearch() {
			uni.navigateTo({
				url: '/pages/problemBase/search?type=1'
			})
		},
		askBtn(e) {
			if (e == 1) {
				uni.setStorageSync('hotAskStatus', 1)
				uni.switchTab({
					url: '/pages/exchange/index/index'
				})
			} else {
				uni.navigateTo({
					url: '/pages/exchange/quickQuestion/index'
				})
			}
		},
		//请求小竹咨询列表
		getConsultList() {
			getList({
				page: 1,
				pagesize: 10,
			}).then(res => {
				if (res.code == 1) {
					this.consultList = res.data;
				}
			})
		},

		//去提问
		goAsk(item) {
			console.log(item);
			uni.navigateTo({
				url: '/pages/exchange/quickQuestion/index?id=' + item.user_id
			})
		},

		//去小竹资讯详情
		goConsultDetails(e) {
			uni.navigateTo({
				url: '/consult/consultDetails/index?id=' + e.id
			})
		},
	},
	onLoad(e) {
	},
	onShow() {
		this.getConsultList()
	}

};